home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MATH / NRPAS13 / GAMMQ.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-29  |  352b  |  16 lines

  1. FUNCTION gammq(a,x: real): real;
  2. VAR
  3.    gamser,gln: real;
  4. BEGIN
  5.    IF ((x < 0.0) OR (a <= 0.0)) THEN BEGIN
  6.       writeln('pause in GAMMQ - invalid arguments'); readln
  7.    END;
  8.    IF (x < a+1.0) THEN BEGIN
  9.       gser(a,x,gamser,gln);
  10.       gammq := 1.0-gamser
  11.    END ELSE BEGIN
  12.       gcf(a,x,gamser,gln);
  13.       gammq := gamser
  14.    END
  15. END;
  16.